package com.etc.entity;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 标准商品的bean
 */
public class Goods implements Serializable {
    private int goodsid;
    private String goodsname;
    //    private BigDecimal goodsprice;
    private double goodsprice;
    private String goodsinfo;
    private int goodscount;
    private String cover;
    private int typeid; //? 更合理关联实体对象

    private GoodsType goodsType = new GoodsType();

    private int shopid; //? 更合理关联实体对象

    private Shop shop = new Shop();

    public GoodsType getGoodsType() {
        return goodsType;
    }

    public void setGoodsType(GoodsType goodsType) {
        this.goodsType = goodsType;
    }

    public Shop getShop() {
        return shop;
    }

    public void setShop(Shop shop) {
        this.shop = shop;
    }

    private int goodsstate;

    //折中处理调用方法
    public void setTypename(String typename){
        this.goodsType.setTypename(typename);
    }

    public void setTypeinfo(String typeinfo){
        this.goodsType.setTypeinfo(typeinfo);
    }

    public void setShopname(String shopname){
        this.shop.setShopname(shopname);
    }

    @Override
    public String toString() {
        return "Goods{" +
                "goodsid=" + goodsid +
                ", goodsname='" + goodsname + '\'' +
                ", goodsprice=" + goodsprice +
                ", goodsinfo='" + goodsinfo + '\'' +
                ", goodscount=" + goodscount +
                ", cover='" + cover + '\'' +
                ", typeid=" + typeid +
                ", shopid=" + shopid +
                ", goodsstate=" + goodsstate +
                '}';
    }

    public int getGoodsid() {
        return goodsid;
    }

    public void setGoodsid(int goodsid) {
        this.goodsid = goodsid;
    }

    public String getGoodsname() {
        return goodsname;
    }

    public void setGoodsname(String goodsname) {
        this.goodsname = goodsname;
    }

    public double getGoodsprice() {
        return goodsprice;
    }

    public void setGoodsprice(double goodsprice) {
        this.goodsprice = goodsprice;
    }

    public String getGoodsinfo() {
        return goodsinfo;
    }

    public void setGoodsinfo(String goodsinfo) {
        this.goodsinfo = goodsinfo;
    }

    public int getGoodscount() {
        return goodscount;
    }

    public void setGoodscount(int goodscount) {
        this.goodscount = goodscount;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public int getTypeid() {
        return typeid;
    }

    public void setTypeid(int typeid) {
        this.typeid = typeid;
    }

    public int getShopid() {
        return shopid;
    }

    public void setShopid(int shopid) {
        this.shopid = shopid;
    }

    public int getGoodsstate() {
        return goodsstate;
    }

    public void setGoodsstate(int goodsstate) {
        this.goodsstate = goodsstate;
    }
}
